	<template>
		<view>
			<view class="staff">
				<view class="staff-em"></view>
				<view class="staff-text">我邀请的商家</view>
			</view>
			
			<!-- <scroll-view scroll-y :style="'height:'+scrollH+'px;'"> -->
				<block v-for="( item, index ) in factory_list_data" :key="index">
					<view class="flex-column">
						<view @tap="xiangqing( index, item.id )" class="d-flex a-center flex-row ml-5 mr-5" >
							<view style="width: 550rpx;">
								<view class="mt-2"><text style="color: #777;">商家名称：</text>{{ item.name }}</view>
								<view class="mt-1"><text style="color: #777;">商家号码：</text>{{ item.tel }}</view>
							</view>
							
							<view :class="item.status == 0 ? 'no-pass' : 'pass'">{{ item.status ? '已通过' : '待审核' }}</view>
						</view>
						
						<divider />
					</view>
				</block>
				
				<uni-load-more :status="status" style="margin-bottom: 140rpx;" />
				
			<!-- </scroll-view> -->
		</view>
	</template>

	<script>
		import uniLoadMore from '../../components/common/uni-load-more.vue'
		
		export default {
			components: {
				uniLoadMore,
			},
			props: {
				status:null,
				scrollH:null,
				factory_list_data: null,
				activity_id: null,
			},
			data() {
				return {
					factory_id: '',
				}
			},
			onLoad(e) {
			},
			methods: {
				//审核通过
				tongguo(index, factory_id) {
					this.factory_id = this.factory_list_data[index].id,
					// console.log(this.factory_id)
					// console.log(this.factory_list_data,9999)
					uni.navigateTo({
						url: '../../pages/administrator/admin_management?factory_id=' + this.factory_id,
					})
					
					// this.$comm.request({
					// 	url: 'api/check_factory',
					// 	method: 'POST',
					// 	data: {
					// 		factory_id: factory_id
					// 	},
					// 	success: res => {
					// 		uni.showToast({
					// 			title: res.data.msg,
					// 			icon: 'success',
					// 			duration: 1000,
					// 		});
					// 		// this.$emit('factory_list')
					// 		this.$set(this.factory_list_data[index],'status',1)
					// 	}
					// });
				},
				
				//打开商家邀约详情
				xiangqing(index, id, activity_id) {
					// console.log(this.factory_list_data[index].status)
					uni.navigateTo({
						url: 'admin_management?factory_id=' + id + '&activity_id=' + this.activity_id + '&status=' + this.factory_list_data[index].status,
					});
				},
			}
		}
	</script>

	<style lang="scss" scoped>
	@import '@/common/main.css';
	@import  '@/common/zcm-main.css';
	
		page{
			font-size: 30rpx;
		}
		.staff {
			display: flex;
			flex-direction: row;
			align-items: center;
			margin-left: 50rpx;
			padding-top: 30rpx;
		
			.staff-em {
				height: 35rpx;
				width: 10rpx;
				background-color: #475dfc;
				border-radius: 50rpx;
			}
		
			.staff-text {
				font-weight: bold;
				margin-left: 10rpx;
			}
		}
		
		@mixin pass1 {
			// margin-left: 50rpx;
			font-size: 25rpx;
			color: #ffffff;
			padding: 5rpx 10rpx 5rpx 10rpx;
			text-align: center;
			border-radius: 50rpx;
		}
		
		.no-pass {
			@include pass1;
			background-color: #A40000;
		}
		
		.pass {
			@include pass1;
			background-color: #5fb256;
		}
		
	</style>
